package com.borqs.samples.developer;

import com.borqs.samples.SampleService;
import com.borqs.samples.SampleTest;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;

public class DeveloperActivity extends Activity implements OnClickListener {

    private Button sampleButton, queryButton;
    private ListView develop_list;

    private DeveloperDBAnlaysis mDeveloperDBAnlaysis;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.developer_layout);
        init();
        findView();
        setListener();
    }

    private void init() {
        mDeveloperDBAnlaysis = new DeveloperDBAnlaysis(this);
    }

    private void findView() {
        sampleButton = (Button) findViewById(R.id.develop_sample);
        queryButton = (Button) findViewById(R.id.develop_query);
        develop_list = (ListView) findViewById(R.id.develop_list);
    }

    private void setListener() {
        sampleButton.setOnClickListener(this);
        queryButton.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
        case R.id.develop_sample:
            startService(new Intent(this, SampleService.class));
            break;
        case R.id.develop_query:
            mDeveloperDBAnlaysis.getConclusiveData();
            break;

        default:
            break;
        }
    }
}
